Skip to content

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jun 1, 2025

Strictly speaking, we're gaining a bit as well:

Modules/blake2module.c | 723
1 file changed, 357 insertions(+), 366 deletions(-)

I've updated hmacmodule.c as well so that my two functions for detecting SIMD features have the same body. I could have a separate header, but it's easier that way (ideally, I'd like to rely on #125022 for SIMD detection in the future).

@picnixz picnixz requested review from gpshead and tiran as code owners June 1, 2025 12:23
@picnixz picnixz changed the title gh-135004: rewrite and cleanup _blake2module.c gh-135004: rewrite and cleanup blake2module.c Jun 1, 2025
@picnixz
Copy link
Member Author

picnixz commented Jun 1, 2025

!buildbot FIPS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 17365bd 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135006%2Fmerge

The command will test the builders whose names match following regular expression: FIPS

The builders matched are:

  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 RHEL8 FIPS No Builtin Hashes PR
  • AMD64 CentOS9 FIPS No Builtin Hashes PR
  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR

@picnixz picnixz added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 1, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 4b4b66c 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135006%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 1, 2025
@picnixz picnixz force-pushed the ref/hashlib/blake-2-new-135004 branch from 4b4b66c to ce0e848 Compare June 7, 2025 13:34
@picnixz picnixz force-pushed the ref/hashlib/blake-2-new-135004 branch from 70ea98e to b16e301 Compare June 8, 2025 09:30
@picnixz picnixz added the type-refactor Code refactoring (with no changes in behavior) label Jun 8, 2025
@picnixz picnixz self-assigned this Jun 8, 2025
@picnixz picnixz merged commit 3cb1097 into python:main Jun 9, 2025
45 checks passed
@picnixz picnixz deleted the ref/hashlib/blake-2-new-135004 branch June 9, 2025 07:17
lkollar pushed a commit to lkollar/cpython that referenced this pull request Jun 19, 2025
* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-refactor Code refactoring (with no changes in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants